Markov chain tree theorem